﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlRegisterTips.ascx.cs" Inherits="UserControl_ControlRegisterTips" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc1" %>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />

<uc1:uscMsgBox ID="uscMsgBox1" runat="server" />

<script type="text/javascript">
    function pageLoad() {
        $("#<%= ImgNew.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
        });
       
        $("#<%= ImgFind.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
        });
        $("#<%= ImgSave.ClientID %>").click(function () {
            
                $.blockUI({
                    message: '<h1>Xin vui lòng chờ xử lý</h1>',
                    css: {
                        border: 'none',
                        padding: '15px',
                        backgroundColor: '#f00',
                        opacity: .5,
                        color: '#fff'
                    }
                });
           
        });
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }
    }  
   
</script>    
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
    
    <asp:PostBackTrigger ControlID="ImgSave" />
</Triggers>
    <ContentTemplate>
        <fieldset>
            <legend>Khai báo mẫu tin sức khỏe</legend>
        </fieldset>
            <asp:Panel ID="Panel1" runat="server" BackColor="#EBEBBE" BorderStyle="None" 
                    Height="33px" Width="100%">
                    <asp:ImageButton ID="ImgNew" runat="server" CausesValidation="False" 
                        Height="25px" Width="25px" ImageUrl="~/image/New File.png" OnClick="ImgNew_Click" 
                        ToolTip="Tạo mới" />
                    &nbsp;<asp:ImageButton ID="ImgSave" runat="server" ImageUrl="~/image/Save.png" 
                        OnClick="ImgSave_Click" Width="25px" Height="25px" ToolTip="Lưu thông tin" />
                      &nbsp;<asp:ImageButton ID="ImgFind" runat="server" Height="25px" CausesValidation="False" 
                        ImageUrl="~/image/Find.png" Width="25px" 
                        ToolTip="Tìm ngành hàng" onclick="ImgFind_Click" />
                </asp:Panel>
    <br />
    <cc1:TabContainer ID="TabContainer1" runat="server" 
            ActiveTabIndex="1" Height="300px" Width="100%" BackColor="#CCFFFF" 
            Font-Names="Arial">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Thông tin" TabIndex="0">
            <ContentTemplate>
                <fieldset>
                    <div class="fm-req">
                       <label for="TxtMaNganhHang">Mã Tip:</label>
                       <asp:TextBox ID="TxtMaTip" ReadOnly="true" BackColor="Yellow" runat="server"></asp:TextBox>
                    </div>
                     <div class="fm-req">
                       <label for="TxtMaNganhHang">Tiêu đề(VN):</label>
                       <asp:TextBox ID="TxtTitleVN" runat="server" Width="300px"></asp:TextBox>
                    </div>
                     <div class="fm-req">
                       <label for="TxtMaNganhHang">Tiêu đề(EN):</label>
                       <asp:TextBox ID="txtTitleEN" runat="server" Width="300px"></asp:TextBox>
                    </div>
                     <div class="fm-req">
                     <label for="TxtMaNganhHang">File Html(VN):</label>
                      <asp:FileUpload ID="FileHtmlVN" runat="server" />
                     </div>
                      <div class="fm-req">
                     <label for="TxtMaNganhHang">File Html(EN):</label>
                      <asp:FileUpload ID="FileHtmlEN" runat="server" />
                     </div>
                     <div class="fm-req">
                     <label for="TxtMaNganhHang">File Hình ảnh(VN):</label>
                      <asp:FileUpload ID="FileImageVN" runat="server" />
                     </div>
                      <div class="fm-req">
                       <label for="TxtMaNganhHang">Kích hoạt:</label>
                        <asp:CheckBox ID="CheckActive" runat="server" />
                    </div>
                </fieldset>
            
</ContentTemplate>
            

</cc1:TabPanel>
             <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Tìm kiếm" TabIndex="1">
            <ContentTemplate>
                 <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                    AutoGenerateColumns="False" BackColor="#DEBA84" BorderColor="#DEBA84" 
                                    BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" 
                                    DataKeyNames="TipID" 
                                    Width="100%" 
                         EnableModelValidation="True"
                     onpageindexchanging="GridView1_PageIndexChanging" 
                     onrowcancelingedit="GridView1_RowCancelingEdit1" 
                     onrowdeleting="GridView1_RowDeleting1" onrowediting="GridView1_RowEditing1" 
                     onrowupdating="GridView1_RowUpdating1">
                     <Columns>
                                    <asp:BoundField DataField="TipID" ReadOnly="True" HeaderText="Mã Tip" />
                                    <asp:TemplateField HeaderText="Tiêu đề(VN)">
                                        <EditItemTemplate>
                                                                                    <asp:TextBox ID="txtEditTitleVN" TextMode="MultiLine" Columns="10" Rows="5" runat="server" 
                                                                                            Text='<%# Bind("TitleVN") %>'></asp:TextBox>
                                            
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                                                                   
                                           <asp:Literal ID="litShowTitleVN" runat="server" Text='<%# Bind("TitleVN") %>'></asp:Literal>
                                    </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Tiêu đề(EN)">
                                        <EditItemTemplate>
                                                                                    <asp:TextBox ID="txtEditTitleEN" TextMode="MultiLine" Columns="10" Rows="5" runat="server" 
                                                                                            Text='<%# Bind("TitleEN") %>'></asp:TextBox>
                                            
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                                                                   <asp:Literal ID="litShowTitleVN" runat="server" Text='<%# Bind("TitleEN") %>'></asp:Literal>
                                            

                                    </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="TipUrlVN" HeaderText="Đường dẫn(VN)" />
                                    <asp:BoundField DataField="TipUrlEN" HeaderText="Đường dẫn(EN)" />
                                    <asp:BoundField DataField="CreateDate" ReadOnly="True" HeaderText="Ngày tạo" />
                                    <asp:BoundField DataField="ModifyDate" ReadOnly="True" HeaderText="Ngày sửa" />
                                    <asp:CheckBoxField DataField="Active" ReadOnly="True" HeaderText="Kích hoạt" />
                                    <asp:BoundField DataField="IndexLevel" HeaderText="Thứ tự" />
                                    
                                    <asp:TemplateField HeaderText="Hình ảnh">
                                        <ItemTemplate>
                                            <asp:Image ID="ImagePath" runat="server" Width="100px" Height="100px" 
                                                    ImageUrl='<%# "~/ImageTip/" + Eval("ImagePath")%>'/>
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                                                                      </EditItemTemplate>
                                    </asp:TemplateField>
                                     <asp:CommandField CausesValidation="False" HeaderText="Sửa"   
                                        ShowEditButton="True" ButtonType="Button" EditText="Sửa" CancelText="Thoát" 
                                        UpdateText="Cập nhập">
                                     <ControlStyle Height="25px" Width="50px" />
                                    <ItemStyle Height="25px" Width="50px" />
                                    </asp:CommandField>
                                     <asp:CommandField  ButtonType="Button" DeleteText="Xóa" 
                                        CausesValidation="False" HeaderText="Xóa" ShowDeleteButton="True" >
                                   


                                    <ControlStyle Height="25px" Width="50px" />
                                    <ItemStyle Height="25px" Width="50px" />
                                    </asp:CommandField>
                                   


                    </Columns>

                                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                </asp:GridView>



             
</ContentTemplate>
</cc1:TabPanel>
      </cc1:TabContainer>
    </ContentTemplate>
</asp:UpdatePanel>